<template>
	<view class="warranty">
		<view class="tab">
			
		</view>
		<view class="inwarranty">
			<view class="vailCard" @tap="jumpDetail(item.warrantyStatus,item.wcId)" v-for="item in list" :key="item.svcRecordId">
				<view class="row">
					<view class="right">
						<icon class="iconfont iconshijian hascolor" type="" />
						{{item.svcDate.split('.')[0].split(':')[0] }}:{{item.svcDate.split('.')[0].split(':')[1]}}
						</view>
					<view class="left_f">
						{{item.svcName}}
					</view>
				</view>
				<view  class="row">
					<view class="right txt">{{item.liaison}}</view>
					<view class="left">{{item.liaisonPhone}}</view>
				</view>
				<view class="row address">
					{{item.svcPosition}}
				</view>
				<view class="showButton f18 ed" v-if="item.warrantyStatus ==0">
					<icon class="iconfont iconlock1 f22" type="" />
				</view>
				<view class="showButton f18" v-if="item.warrantyStatus ==1">
					<icon class="iconfont iconunlock1 hascolor f22" type="" />
				</view>
			</view>
			<view class="nullbox" v-if="list.length == 0">
				没有服务记录
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
		},
		data() {
			return {
				list:[]
			}
		},
		onLoad() {
			
		},
		onShow(){
			this.getServerList()
		},
		methods: {
			//warrantyStatus 0没点过，1是点过了
			jumpDetail(warrantyStatus,wcId){
				// console.log(id)
				if(warrantyStatus==0){
					return
				}
				uni.navigateTo({
					url:"../cardDetails/cardDetails_s?wcId="+wcId
				})
			},
			getServerList(){
				this.postApi('listByUser','GET',
				{
					loading:true
				}).then(res=>{
					this.list = res.data
					console.log('list',this.list)
				})
			}
		}
	}
</script>

<style lang="less">
	@import '@/common/common.less';
	.warranty{
		background-color: #eeeeee;
		display: flex;
		flex-direction: column;
		position: relative;
		height: 100%;
		.tab{
			height: 104rpx;
			display: flex;
			justify-content: space-evenly;
			align-items: center;
			background-color: #ffffff;
			.acitve{
				color: @primary-color;
			}
		}
		.inwarranty{
			width: 95%;
			margin: 0 auto;
			height: calc( 100% - 104rpx) ;
			.vailCard{
				margin-top: 17rpx;
				background-color: #FFFFFF;
				border-radius: 10rpx;
				padding: 23rpx 30rpx;
				color: #555555;
				.row{
					position: relative;
					display: flex;
					justify-content: space-between;
					margin-bottom: 22rpx;
					.right{
						.iconfont{
							margin-right: 30rpx;
						}
						.hascolor{
							color: @primary-color;
						}
						
					}
					.right.txt{
						margin-left: 60rpx;
					}
					.right.detil{
						color: @primary-color;
						margin-left: 60rpx;
					}
					.left_f{
						color: @primary-color;
					}
				}
				.row.address{
					margin-left: 60rpx;
				}
				.showButton{
					height: 88rpx;
					line-height: 88rpx;
					background-color: @primary-color;
					text-align: center;
					font-weight: bold;
					color: #FFFFFF;
					border-radius: 10rpx;
				}
				.ed{
					background-color: #aaaaaa;
				}
			}
			.nullbox{
				text-align: center;
				margin-top:200rpx;
				color: #555555;
			}
			.grey{
				color:#555555
			}
		}
	}
</style>
